package com.spring.demo1.eg2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author vhans
 */
@Component
public class Service2 {
    private Service1 service1;

    public void m1() {
        System.out.println("service2 m1()");
        // service2中注入的是早期的service1，注入的时候service1还不是一个代理对象，所以没有拦截器中的功能
        this.service1.m1();
    }

    @Autowired
    public void setService1(Service1 service1) {
        this.service1 = service1;
    }

    public Service1 getService1() {
        return service1;
    }
}
